/**
 * 
 */
package design_pattern.template.bank;

/**
 * @author linzq
 * 
 */
public class CDAccount extends Account {

	@Override
	protected double doGetAmount(String accountType, String accountNumber) {
		System.out.println("从数据库中读取账号号码及其类型所对应的存款额。");
		// retreive from database
		return Math.random() * 100000;
	}

	@Override
	protected String doGetAccountType() {
		System.out.println("读取账号类型");
		return "MONEY_CD";
	}

	@Override
	protected double doCalcInterestRate(String accountType) {
		System.out.println("读取账号类型：" + accountType + " 所对应的利率。");
		return Math.random();
	}

}
